package com.aspose.cells;

class zcdy {
   private Workbook a;
   private zcda b;
   private zbxz c;
   private Worksheet d;
   private zpa e;
   private zoz f;
   private int g;
   private byte[] h;
   private int i;
   private Cells j;
   private ListObject k = null;

   zcdy(zcda var1) {
      this.b = var1;
      this.a = var1.a;
      this.f = var1.b;
   }

   void a(zpa var1, zbxz var2) throws Exception {
      this.e = var1;
      this.d = var1.d;
      this.j = this.d.getCells();
      this.c = var2;

      while(true) {
         this.g = this.c.a();
         switch(this.g) {
         case 161:
            this.d();
            break;
         case 343:
            this.a();
            break;
         case 344:
            this.c.a(1L);
            return;
         case 345:
            this.b();
            break;
         case 513:
            this.c();
            break;
         default:
            this.i = this.c.b();
            this.c.a((long)this.i);
         }
      }
   }

   private void a() throws Exception {
      this.h = this.b.a(this.c);
      CellArea var1 = zcch.a(this.h, 0);
      this.k = new ListObject(this.d.getListObjects());
      this.k.a(var1.StartRow);
      this.k.b(var1.StartColumn);
      this.k.c(var1.EndRow);
      this.k.d(var1.EndColumn);
      this.d.getListObjects().a(this.k);
      int var2 = com.aspose.cells.b.a.zc.a(this.h, 16);
      this.k.c = zcee.B(var2);
      int var3 = com.aspose.cells.b.a.zc.a(this.h, 20);
      this.k.k(var3);
      int var4 = com.aspose.cells.b.a.zc.a(this.h, 24);
      if (var4 != 0) {
         this.k.l(var4);
      }

      byte var5 = this.h[32];
      this.k.b((var5 & 255 & 1) != 0);
      this.k.c((var5 & 255 & 2) != 0);
      this.k.a((var5 & 255 & 8) != 0);
      this.k.d((var5 & 255 & 16) != 0);
      int var6 = com.aspose.cells.b.a.zc.a(this.h, 28);
      if (var6 != 0) {
         this.k.m(var6);
      } else {
         this.k.b(false);
      }

      this.k.h[0] = com.aspose.cells.b.a.zc.a(this.h, 36);
      this.k.h[1] = com.aspose.cells.b.a.zc.a(this.h, 40);
      this.k.h[2] = com.aspose.cells.b.a.zc.a(this.h, 44);
      this.k.h[3] = com.aspose.cells.b.a.zc.a(this.h, 48);
      this.k.h[4] = com.aspose.cells.b.a.zc.a(this.h, 52);
      this.k.h[5] = com.aspose.cells.b.a.zc.a(this.h, 56);
      this.k.j(com.aspose.cells.b.a.zc.a(this.h, 60));
      byte var7 = 64;
      int[] var8 = new int[]{var7};
      String var9 = zcch.a(this.h, var8);
      int var11 = var8[0];
      if (var9 != null && var9.length() > 0) {
         this.k.d(var9);
      }

      var8[0] = var11;
      String var10 = zcch.a(this.h, var8);
      var11 = var8[0];
      if (var10 != null && var10.length() > 0) {
         this.k.setDisplayName(var10);
      }

      var8[0] = var11;
      this.k.c(zcch.a(this.h, var8));
      var11 = var8[0];
   }

   private void b() throws Exception {
      this.h = this.b.a(this.c);
      int var1 = com.aspose.cells.b.a.zc.a(this.h, 0);
      int var2 = 0;

      while(true) {
         this.g = this.c.a();
         switch(this.g) {
         case 346:
            this.c.a(1L);
            return;
         case 347:
            this.a(var2);
            ++var2;
            break;
         default:
            this.i = this.c.b();
            this.c.a((long)this.i);
         }
      }
   }

   private void a(int var1) throws Exception {
      this.h = this.b.a(this.c);
      byte var2 = 24;
      int[] var3 = new int[]{var2};
      String var4 = zcch.a(this.h, var3);
      int var9 = var3[0];
      ListColumn var5 = new ListColumn(this.k.getListColumns(), var4, var1);
      this.k.getListColumns().a(var5);
      var5.o = com.aspose.cells.b.a.zc.a(this.h, 0);
      int var6 = zcee.D(com.aspose.cells.b.a.zc.a(this.h, 4));
      var5.a(var6);
      var5.k[0] = com.aspose.cells.b.a.zc.a(this.h, 8);
      var5.k[1] = com.aspose.cells.b.a.zc.a(this.h, 12);
      var5.k[2] = com.aspose.cells.b.a.zc.a(this.h, 16);
      var5.b(com.aspose.cells.b.a.zc.a(this.h, 20));
      var3[0] = var9;
      String var7 = zcch.a(this.h, var3);
      var9 = var3[0];
      var5.b(var7);
      var5.a(var7);
      var3[0] = var9;
      String var8 = zcch.a(this.h, var3);
      var9 = var3[0];
      var5.d(var8);

      while(true) {
         this.g = this.c.a();
         switch(this.g) {
         case 348:
            this.c.a(1L);
            return;
         case 349:
         case 350:
         default:
            this.i = this.c.b();
            this.c.a((long)this.i);
            break;
         case 351:
            this.h = this.b.a(this.c);
            var5.e = (this.h[0] & 255 & 2) != 0;
            var5.f = new byte[this.h.length - 1];
            System.arraycopy(this.h, 1, var5.f, 0, this.h.length - 1);
            break;
         case 352:
            this.h = this.b.a(this.c);
            var5.c = (this.h[0] & 255 & 2) != 0;
            var5.g = new byte[this.h.length - 1];
            System.arraycopy(this.h, 5, var5.g, 0, this.h.length - 1);
         }
      }
   }

   private void c() throws Exception {
      this.h = this.b.a(this.c);
      byte var1 = this.h[0];
      this.k.setShowTableStyleFirstColumn((var1 & 255 & 1) != 0);
      this.k.setShowTableStyleLastColumn((var1 & 255 & 2) != 0);
      this.k.setShowTableStyleRowStripes((var1 & 255 & 4) != 0);
      this.k.setShowTableStyleColumnStripes((var1 & 255 & 8) != 0);
      this.k.setTableStyleName(zcch.d(this.h, 2));
   }

   private void d() throws Exception {
      this.h = this.b.a(this.c);
      AutoFilter var1 = this.k.getAutoFilter();
      int var2 = com.aspose.cells.b.a.zc.a(this.h, 0);
      int var3 = com.aspose.cells.b.a.zc.a(this.h, 4);
      int var4 = com.aspose.cells.b.a.zc.a(this.h, 8);
      int var5 = com.aspose.cells.b.a.zc.a(this.h, 12);
      var1.setRange(var2, var4, var5);

      while(true) {
         this.g = this.c.a();
         switch(this.g) {
         case 162:
            this.c.a(1L);
            return;
         case 163:
            this.a(var1);
            break;
         default:
            this.i = this.c.b();
            this.c.a((long)this.i);
         }
      }
   }

   private void a(AutoFilter var1) throws Exception {
      this.h = this.b.a(this.c);
      int var2 = com.aspose.cells.b.a.zc.a(this.h, 0);
      boolean var3 = (this.h[4] & 255 & 1) == 1;
      boolean var4 = (this.h[4] & 255 & 2) == 0;
      FilterColumn var5 = null;

      while(true) {
         this.g = this.c.a();
         switch(this.g) {
         case 164:
            this.c.a(1L);
            if (var5 != null) {
               var1.e.a(var5);
            }

            return;
         case 165:
            var5 = new FilterColumn(var1.e, var2, var3, var4);
            var5.setFilterType(3);
            MultipleFilterCollection var26 = new MultipleFilterCollection();
            var5.setFilter(var26);
            this.a(var26);
            break;
         case 166:
         case 167:
         default:
            this.i = this.c.b();
            this.c.a((long)this.i);
            break;
         case 168:
            this.h = this.b.a(this.c);
            var5 = new FilterColumn(var1.e, var2, var3, var4);
            var5.setFilterType(0);
            ColorFilter var22 = new ColorFilter(var5);
            var5.setFilter(var22);
            var22.setFilterByFillColor(this.h[4] == 1);
            var22.a(com.aspose.cells.b.a.zc.a(this.h, 0));
            break;
         case 169:
            this.h = this.b.a(this.c);
            int var23 = com.aspose.cells.b.a.zc.a(this.h, 0);
            int var24 = com.aspose.cells.b.a.zc.a(this.h, 4);
            var5 = new FilterColumn(var1.e, var2, var3, var4);
            var5.setFilterType(4);
            IconFilter var25 = new IconFilter(var5);
            var5.setFilter(var25);
            var25.setIconSetType(zcee.q(var23));
            var25.setIconId(var24);
            break;
         case 170:
            this.h = this.b.a(this.c);
            var5 = new FilterColumn(var1.e, var2, var3, var4);
            var5.setFilterType(5);
            boolean var13 = (this.h[0] & 255 & 1) != 0;
            boolean var14 = (this.h[0] & 255 & 2) != 0;
            boolean var15 = (this.h[0] & 255 & 4) != 0;
            double var16 = com.aspose.cells.b.a.zc.f(this.h, 1);
            double var18 = com.aspose.cells.b.a.zc.f(this.h, 9);
            int var20 = 10;
            if (var15) {
               var20 = (int)var16;
            }

            Top10Filter var21 = new Top10Filter(var13, var14, var20);
            var5.setFilter(var21);

            try {
               var21.setCriteria(var18);
            } catch (Exception var28) {
               ;
            }
            break;
         case 171:
            this.h = this.b.a(this.c);
            var5 = new FilterColumn(var1.e, var2, var3, var4);
            var5.setFilterType(2);
            DynamicFilter var6 = new DynamicFilter();
            var5.setFilter(var6);
            int var7 = com.aspose.cells.b.a.zc.a(this.h, 0);
            var6.setDynamicFilterType(zcee.t(var7));
            boolean var8 = this.h[4] == 1;
            double var9 = com.aspose.cells.b.a.zc.f(this.h, 5);
            double var11 = com.aspose.cells.b.a.zc.f(this.h, 13);
            if (var8) {
               var6.setMaxValue(var11);
            }

            var6.setValue(var9);
            break;
         case 172:
            var5 = new FilterColumn(var1.e, var2, var3, var4);
            var5.setFilterType(1);
            CustomFilterCollection var27 = new CustomFilterCollection();
            var5.setFilter(var27);
            this.a(var27);
         }
      }
   }

   private void a(CustomFilterCollection var1) throws Exception {
      this.h = this.b.a(this.c);
      boolean var2 = this.h[0] == 1;
      var1.setAnd(var2);

      while(true) {
         this.g = this.c.a();
         switch(this.g) {
         case 173:
            this.c.a(1L);
            return;
         case 174:
            this.h = this.b.a(this.c);
            byte var3 = this.h[0];
            byte var4 = this.h[1];
            CustomFilter var5 = new CustomFilter();
            var1.a(var5);
            var5.setFilterOperatorType(zcee.v(var4 & 255));
            if (var3 == 6) {
               String var6 = zcch.d(this.h, 10);
               var5.setCriteria(var6);
            } else {
               var5.setCriteria(com.aspose.cells.b.a.zc.f(this.h, 2));
            }
         }
      }
   }

   private void a(MultipleFilterCollection var1) throws Exception {
      this.h = this.b.a(this.c);
      boolean var2 = this.h[0] == 1;
      if (var2) {
         var1.setMatchBlank(true);
      }

      int var3 = com.aspose.cells.b.a.zc.a(this.h, 4);
      var1.b = zcee.s(var3);

      while(true) {
         this.g = this.c.a();
         switch(this.g) {
         case 166:
            this.c.a(1L);
            return;
         case 167:
            this.h = this.b.a(this.c);
            byte var4 = 0;
            int[] var5 = new int[]{var4};
            String var6 = zcch.a(this.h, var5);
            int var8 = var5[0];
            var1.b(var6);
            break;
         case 175:
            this.h = this.b.a(this.c);
            DateTimeGroupItem var7 = new DateTimeGroupItem();
            var1.a(var7);
            var7.setYear(com.aspose.cells.b.a.zc.b(this.h, 0));
            var7.setMonth(com.aspose.cells.b.a.zc.b(this.h, 2));
            var7.setDay(com.aspose.cells.b.a.zc.b(this.h, 4));
            var7.setHour(com.aspose.cells.b.a.zc.b(this.h, 6));
            var7.setMinute(com.aspose.cells.b.a.zc.b(this.h, 8));
            var7.setSecond(com.aspose.cells.b.a.zc.b(this.h, 10));
            var7.setDateTimeGroupingType(zcee.x(com.aspose.cells.b.a.zc.a(this.h, 20)));
            break;
         default:
            this.i = this.c.b();
            this.c.a((long)this.i);
         }
      }
   }
}
